/**************************************************************************
 * Copyright (C) 2010 mrovi@interfete-web-club.com
 *
 *
 **************************************************************************/

#ifndef SYSMON_H
#define SYSMON_H

#include "common.h"
#include "area.h"

typedef struct SysmonGraph {
	Imlib_Image image;
	int x, y;
	int width, height;
	double *history;
	double shade;
	char text_topleft[256];
	char text_topright[256];
	Color topright_color;
	double max;
	char id[10];
	double old1;
	double old2;
	int updates;
} SysmonGraph;

typedef struct Sysmon {
	// always start with area
	Area area;
	// config stuff
	int cpu_enabled;
	int mem_enabled;
	int net_enabled;
	int graph_size;		// for vertical panel: height; for horizontal: width
	int graphs_per_row;	// for vertical panel only
	PangoFontDescription *sysmon_font_descr;
	Color graph_bg_color;
	Color cpu_color_start;
	Color cpu_color_end;
	Color cpu_font_color;
	Color cpu_freq_color;
	Color mem_color_start;
	Color mem_color_end;
	Color mem_font_color;
	Color net_color_start;
	Color net_color_end;
	Color net_font_color;
	// internal stuff
	int ncpus;			// number of virtual cpus
	int nphycores;      // number of physical cpu cores, for all cpus
	int *num_cores_per_cpu;
	int *cpu2phycore;
	int nphycpus;
	int ngraphs;
	GSList *graphs;
} Sysmon;

extern int sysmon_enabled;

// default global data
void default_sysmon();

// initialize launcher : y position, precision, ...
void init_sysmon();
void init_sysmon_panel(void *panel);
void cleanup_sysmon();

int resize_sysmon(void *obj);
void draw_sysmon(void *obj, cairo_t *c);

#endif
